/*
 * DevicesIIC.h
 *
 *      Author: Honrun
 */
#ifndef DEVICESIIC_H_
#define DEVICESIIC_H_


#define I2C_BYTE_WRITE_TIME_OUT     20
#define I2C_BYTE_READ_TIME_OUT      100
#define I2C_BUSY_TIME_OUT           1000
#define I2C_START_OUT               256


void vIIC1Init(void);
void vIIC1DeInit(void);
void vIIC1DMAInit(void);

int8_t cI2CxWriteDatas(I2C_TypeDef *I2Cx, uint16_t usIDAddr, uint16_t usRegAddr, void* pvDatas, int32_t iLength);
int8_t cI2CxReadDatas(I2C_TypeDef *I2Cx, uint16_t usIDAddr, uint16_t usRegAddr, void* pvDatas, int32_t iLength);
int8_t cI2CxDmaWriteDatas(I2C_TypeDef *I2Cx, uint16_t usIDAddr, uint16_t usRegAddr, void* pvDatas, int32_t iLength);
int8_t cI2CxDmaReadDatas(I2C_TypeDef *I2Cx, uint16_t usIDAddr, uint16_t usRegAddr, void* pvDatas, int32_t iLength);


#endif /* DEVICESIIC_H_ */
